<?php

// Start application timer
define('APP_TIME_START', microtime(true));

// Define application environment
switch (getenv('ENVPHP')) {
    case 'loc':
        $environment = 'local';
        break;
    case 'dev':
        $environment = 'development';
        break;
    case 'tst':
        $environment = 'testing';
        break;
    case 'acc':
        $environment = 'staging';
        break;
    case 'pro':
    case 'prod':
        $environment = 'production';
        break;
    default:
        $environment = getenv('ENVPHP');
        break;
}
define('APPLICATION_ENV', $environment);

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
            APPLICATION_PATH,
            realpath(APPLICATION_PATH . '/../library'),
            realpath(APPLICATION_PATH . '/controllers'),
            get_include_path(),
)));
